import request from '@/utils/request'
/**
 * 获取回答列表
 * @param params 
 * @returns 
 */
export const getAnswerList = (params?: any) => {
  return request({
    url: '/anon/answer/list',
    method: 'get',
    params
  })
}
/**
 * 获取问答列表
 * @param params 
 * @returns 
 */
export const getFaqList = (params?: any) => {
  return request({
    url: '/anon/faq/list',
    method: 'get',
    params
  })
}
/**
 * 发布问答
 * @param data 
 * @returns 
 */
export const publishFaq = (data: any) => {
  return request({
    url: '/user/faq',
    method: 'post',
    data
  })
}
/**
 * 获取问答详情
 * @param params
 * @returns 
 */
export const getFaqDetail = (params: any) => {
  return request({
    url: '/anon/faq',
    method: 'get',
    params
  })
}
/**
 * 获取回答列表
 * @param params 
 * @returns 
 */
export const getFaqDetailAnswer = (params: any) => {
  return request({
    url: '/anon/answer/list',
    method: 'get',
    params
  })
}
// 发布问答
export const answerQuestion = (data: any) => {
  return request({
    url: '/user/answer',
    method: 'post',
    data
  })
}
// 采纳回答
export const likeAnswer = (data: any) => {
  return request({
    url: '/user/faq',
    method: 'put',
    data
  })
}
/**
 * 获取7日采纳榜
 * @returns 
 */
export const getLikeTop = () => {
  return request({
    url: '/anon/user/sevenDayAdoption',
    method: 'get',
  })
}
